package com.cetc.sdp.kmga.cs.schema.v2;

import com.alibaba.fastjson.JSONArray;
import com.cetc.sdp.kmga.cs.common.TableMapping;

import javax.ws.rs.DELETE;
import java.io.Serializable;
import java.util.List;

/**
 * @description:
 * @author： DengQiang
 * @date: 2018/2/7 15:40
 */
@Deprecated
public class DesensSchemaDescV2 extends IndexSchemaDesc<DesensSchemaDescV2.LogFieldIndex> {

    public DesensSchemaDescV2(TableMapping tm) {
        super(tm, LogFieldIndex.class);
    }

    public DensesLog buildDensesLog(JSONArray jsonArray) {
        List<String> data = buildLog(jsonArray);
        return new DensesLog(data, logFieldIndex);
    }

    public static class DensesLog implements Serializable {

        private List<String> data;
        private LogFieldIndex logFieldIndex;

        private DensesLog(List<String> data, LogFieldIndex logFieldIndex) {
            this.data = data;
            this.logFieldIndex = logFieldIndex;
        }

        public String get(int index) {
            return data.get(index);
        }

        public String getId() {
            return data.get(logFieldIndex.ID);
        }

        public void setId(String id) {
            this.data.set(logFieldIndex.ID, id);
        }

        public String getTaskTm() {
            return this.data.get(logFieldIndex.TASK_TM);
        }

        public void setTaskTm(String taskTm) {
            this.data.set(logFieldIndex.TASK_TM, taskTm);
        }

        public String getTaskId() {
            return this.data.get(logFieldIndex.TASK_ID);
        }

        public void setTaskId(String taskId) {
            this.data.set(logFieldIndex.TASK_ID, taskId);
        }

        public String getTaskName() {
            return this.data.get(logFieldIndex.TASK_NAME);
        }

        public void setTaskName(String taskName) {
            this.data.set(logFieldIndex.TASK_NAME, taskName);
        }

        public String getTaskType() {
            return this.data.get(logFieldIndex.TASK_TYPE);
        }

        public void setTaskType(String taskType) {
            this.data.set(logFieldIndex.TASK_TYPE, taskType);
        }

        public String getSrcAddr() {
            return this.data.get(logFieldIndex.SRC_ADDR);
        }

        public void setSrcAddr(String srcAddr) {
            this.data.set(logFieldIndex.SRC_ADDR, srcAddr);
        }

        public String getSrcPort() {
            return this.data.get(logFieldIndex.SRC_PORT);
        }

        public void setSrcPort(String srcPort) {
            this.data.set(logFieldIndex.SRC_PORT, srcPort);
        }

        public String getSrcName() {
            return this.data.get(logFieldIndex.SRC_NAME);
        }

        public void setSrcName(String srcName) {
            this.data.set(logFieldIndex.SRC_NAME, srcName);
        }

        public String getSrcDbName() {
            return this.data.get(logFieldIndex.SRC_DB_NAME);
        }

        public void setSrcDbName(String srcDbName) {
            this.data.set(logFieldIndex.SRC_DB_NAME, srcDbName);
        }

        public String getSrcTabName() {
            return this.data.get(logFieldIndex.SRC_TAB_NAME);
        }

        public void setSrcTabName(String srcTabName) {
            this.data.set(logFieldIndex.SRC_TAB_NAME, srcTabName);
        }

        public String getTabNumRows() {
            return this.data.get(logFieldIndex.TAB_NUM_ROWS);
        }

        public void setTabNumRows(String tabNumRows) {
            this.data.set(logFieldIndex.TAB_NUM_ROWS, tabNumRows);
        }

        public String getDeseDetail() {
            return this.data.get(logFieldIndex.DESE_DETAIL);
        }

        public void setDeseDetail(String deseDetail) {
            this.data.set(logFieldIndex.DESE_DETAIL, deseDetail);
        }

        public String getDeseNumRow() {
            return this.data.get(logFieldIndex.DESE_NUM_ROW);
        }

        public void setDeseNumRow(String deseNumRow) {
            this.data.set(logFieldIndex.DESE_NUM_ROW, deseNumRow);
        }

        public String getDeseCondt() {
            return this.data.get(logFieldIndex.DESE_CONDT);
        }

        public void setDeseCondt(String deseCondt) {
            this.data.set(logFieldIndex.DESE_CONDT, deseCondt);
        }

        public String getDestAddr() {
            return this.data.get(logFieldIndex.DEST_ADDR);
        }

        public void setDestAddr(String destAddr) {
            this.data.set(logFieldIndex.DEST_ADDR, destAddr);
        }

        public String getDestPort() {
            return this.data.get(logFieldIndex.DEST_PORT);
        }

        public void setDestPort(String destPort) {
            this.data.set(logFieldIndex.DEST_PORT, destPort);
        }

        public String getDestDbName() {
            return this.data.get(logFieldIndex.DEST_DB_NAME);
        }

        public void setDestDbName(String destDbName) {
            this.data.set(logFieldIndex.DEST_DB_NAME, destDbName);
        }

        public String getDestTabName() {
            return this.data.get(logFieldIndex.DEST_TAB_NAME);
        }

        public void setDestTabName(String destTabName) {
            this.data.set(logFieldIndex.DEST_TAB_NAME, destTabName);
        }

        public String getDestName() {
            return this.data.get(logFieldIndex.DEST_NAME);
        }

        public void setDestName(String destName) {
            this.data.set(logFieldIndex.DEST_NAME, destName);
        }

        public String getDestType() {
            return this.data.get(logFieldIndex.DEST_TYPE);
        }

        public void setDestType(String destType) {
            this.data.set(logFieldIndex.DEST_TYPE, destType);
        }

        public String getExte1() {
            return this.data.get(logFieldIndex.EXTE_1);
        }

        public void setExte1(String exte1) {
            this.data.set(logFieldIndex.EXTE_1, exte1);
        }

        public String getExte2() {
            return this.data.get(logFieldIndex.EXTE_2);
        }

        public void setExte2(String exte2) {
            this.data.set(logFieldIndex.EXTE_2, exte2);
        }

        public String getClientIp() {
            return this.data.get(logFieldIndex.CLIENT_IP);
        }

        public void setClientIp(String clientIp) {
            this.data.set(logFieldIndex.CLIENT_IP, clientIp);
        }

        public String getUsr() {
            return this.data.get(logFieldIndex.USR);
        }

        public void setUsr(String usr) {
            this.data.set(logFieldIndex.USR, usr);
        }

        public String getSrcRuleId() {
            return this.data.get(logFieldIndex.SRC_RULE_ID);
        }

        public void setSrcRuleId(String srcRuleId) {
            this.data.set(logFieldIndex.SRC_RULE_ID, srcRuleId);
        }

        public String getSrcResrcId() {
            return this.data.get(logFieldIndex.SRC_RESRC_ID);
        }

        public void setSrcResrcId(String srcResrcId) {
            this.data.set(logFieldIndex.SRC_RESRC_ID, srcResrcId);
        }

        public String getSrcAuditObjId() {
            return this.data.get(logFieldIndex.SRC_AUDIT_OBJ_ID);
        }

        public void setSrcAuditObjId(String srcAuditObjId) {
            this.data.set(logFieldIndex.SRC_AUDIT_OBJ_ID, srcAuditObjId);
        }

        public String getSrcLevel() {
            return this.data.get(logFieldIndex.SRC_LEVEL);
        }

        public void setSrcLevel(String srcLevel) {
            this.data.set(logFieldIndex.SRC_LEVEL, srcLevel);
        }

        public String getSrcOperType() {
            return this.data.get(logFieldIndex.SRC_OPER_TYPE);
        }

        public void setSrcOperType(String srcOperType) {
            this.data.set(logFieldIndex.SRC_OPER_TYPE, srcOperType);
        }

        public String getReptDeviceNum() {
            return this.data.get(logFieldIndex.REPT_DEVICE_NUM);
        }

        public void setReptDeviceNum(String reptDeviceNum) {
            this.data.set(logFieldIndex.REPT_DEVICE_NUM, reptDeviceNum);
        }

        public String getCreateTm() {
            return this.data.get(logFieldIndex.CREATE_TM);
        }

        public void setCreateTm(String createTm) {
            this.data.set(logFieldIndex.CREATE_TM, createTm);
        }

        public String getActResult() {
            return this.data.get(logFieldIndex.ACT_RESULT);
        }

        public void setActResult(String actResult) {
            this.data.set(logFieldIndex.ACT_RESULT, actResult);
        }

        public String getSrcType() {
            return this.data.get(logFieldIndex.SRC_TYPE);
        }

        public void setSrcType(String srcType) {
            this.data.set(logFieldIndex.SRC_TYPE, srcType);
        }
    }

        public static class LogFieldIndex {

        public int ID = -1;
        public int TASK_TM = -1;
        public int TASK_ID = -1;
        public int TASK_NAME = -1;
        public int TASK_TYPE = -1;
        public int SRC_ADDR = -1;
        public int SRC_PORT = -1;
        public int SRC_NAME = -1;
        public int SRC_DB_NAME = -1;
        public int SRC_TAB_NAME = -1;
        public int TAB_NUM_ROWS = -1;
        public int DESE_DETAIL = -1;
        public int DESE_NUM_ROW = -1;
        public int DESE_CONDT = -1;
        public int DEST_ADDR = -1;
        public int DEST_PORT = -1;
        public int DEST_DB_NAME = -1;
        public int DEST_TAB_NAME = -1;
        public int DEST_NAME = -1;
        public int DEST_TYPE = -1;
        public int EXTE_1 = -1;
        public int EXTE_2 = -1;
        public int CLIENT_IP = -1;
        public int USR = -1;
        public int SRC_RULE_ID = -1;
        public int SRC_RESRC_ID = -1;
        public int SRC_AUDIT_OBJ_ID = -1;
        public int SRC_LEVEL = -1;
        public int SRC_OPER_TYPE = -1;
        public int REPT_DEVICE_NUM = -1;
        public int CREATE_TM = -1;
        public int ACT_RESULT = -1;
        public int SRC_TYPE = -1;
    }
}
